<!--
 * @Date: 2022-04-15 15:01:19
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-04-16 01:06:10
 * @FilePath: \Vue3-ts-cms\src\views\login\components\login-phone.vue
 * @description: 文件描述
-->
<template>
  <el-form label-width="60px" ref="formRef">
    <el-form-item label="手机号" prop="num">
      <el-input v-model="phone.num" placeholder="请输入手机号" />
    </el-form-item>
    <el-form-item label="验证码" prop="code">
      <div class="get-code">
        <el-input v-model="phone.code" placeholder="请输入验证码" />
        <el-button type="primary" class="get-btn">获取验证码</el-button>
      </div>
    </el-form-item>
  </el-form>
</template>

<script lang="ts">
import { defineComponent, reactive, ref } from 'vue'
import { ElForm } from 'element-plus'
export default defineComponent({
  setup() {
    const phone = reactive({
      num: '',
      code: ''
    })
    const formRef = ref<InstanceType<typeof ElForm>>()
    const loginAction = () => {
      console.log('真正执行手机登录逻辑')
    }
    return {
      phone,
      loginAction,
      formRef
    }
  }
})
</script>

<style scoped>
.get-code {
  display: flex;
}

.get-btn {
  margin-left: 8px;
}
</style>
